using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
    [Table("bgm_project_expense_control"), DataContract]
    public class ProjectExpenseControl
    {

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "BgmProjExpCtrlId", ResourceType = typeof(Resources.ProjectExpenseControlResource))]
        [Column("bgm_proj_exp_ctrl_seq", TypeName="int")]
        public int BgmProjExpCtrlId { get; set; }

        [ForeignKey("FromBgmProjExpCtrl")]
        [DataMember, Display(Name = "FromBgmProjExpCtrlId", ResourceType = typeof(Resources.ProjectExpenseControlResource))]
        [Column("from_bgm_proj_exp_ctrl_seq", TypeName="int")]
        public Nullable<int> FromBgmProjExpCtrlId { get; set; }

        [ForeignKey("BgmProjExp")]
        [DataMember, Display(Name = "BgmProjExpId", ResourceType = typeof(Resources.ProjectExpenseControlResource))]
        [Column("bgm_proj_exp_seq", TypeName="int")]
        public Nullable<int> BgmProjExpId { get; set; }

        [DataMember, Display(Name = "CtrlType", ResourceType = typeof(Resources.ProjectExpenseControlResource))]
        [Column("ctrl_type", TypeName="ntext")]
        public string CtrlType { get; set; }

        [DataMember, Display(Name = "SendOrReceive", ResourceType = typeof(Resources.ProjectExpenseControlResource))]
        [Column("send_or_receive", TypeName="ntext")]
        public string SendOrReceive { get; set; }

        [DataMember, Display(Name = "Amount", ResourceType = typeof(Resources.ProjectExpenseControlResource))]
        [Column("amount", TypeName="decimal")]
        public Nullable<double> Amount { get; set; }

        [DataMember]
        public virtual ProjectExpenseControl FromBgmProjExpCtrl { get; set; }

        [DataMember]
        public virtual ProjectExpense BgmProjExp { get; set; }



        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}